package es.us.isa.jdbl.domain;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.SecondaryTable;
import javax.persistence.SecondaryTables;

@Entity
@SecondaryTables({
	@SecondaryTable(name="content_type_tool", catalog = "webisa", pkJoinColumns={
			@PrimaryKeyJoinColumn(name="nid", referencedColumnName="nid")}),
	@SecondaryTable(name="content_field_email", catalog = "webisa", pkJoinColumns={
			@PrimaryKeyJoinColumn(name="nid", referencedColumnName="nid")}),
	@SecondaryTable(name="content_field_url", catalog = "webisa", pkJoinColumns={
			@PrimaryKeyJoinColumn(name="nid", referencedColumnName="nid")})
})
@DiscriminatorValue("tool")
public class ToolDeveloped extends AbstractNode{
	 @Column(name="field_description_tools_value", table="content_type_tool")
	 private String description;
	 
	 @Column(name="field_email_email", table="content_field_email")
	 private String email;
	 
	 @Column(name="field_url_url", table="content_field_url")
	 private String url;
	 
	 @ManyToMany
		@JoinTable(name="content_field_projects", catalog = "webisa",
				joinColumns=@JoinColumn(name="nid"),
				inverseJoinColumns=@JoinColumn(name="field_projects_nid"))
		private List<Project> projects;
	 
	 @ManyToMany
		@JoinTable(name="content_field_user", catalog = "webisa",
				joinColumns=@JoinColumn(name="nid"),
				inverseJoinColumns=@JoinColumn(name="field_user_uid", referencedColumnName="uid"))
		private List<Member> researchStaff;	 
	
	public ToolDeveloped(){
		
	}



	



	



	public String getUrl() {
		return url;
	}











	public void setUrl(String url) {
		this.url = url;
	}











	public String getDescription() {
		return description;
	}



	public void setDescription(String description) {
		this.description = description;
	}



	public String getEmail() {
		return email;
	}



	public void setEmail(String email) {
		this.email = email;
	}











	public List<Project> getProjects() {
		return projects;
	}











	public void setProject(List<Project> projects) {
		this.projects = projects;
	}











	public List<Member> getResearchStaff() {
		return researchStaff;
	}











	public void setResearchStaff(List<Member> researchStaff) {
		this.researchStaff = researchStaff;
	}
}
